Learn R Programming

forensim (version 2.0)

simugeno constructor: simugeno constructor

Description

Constructor for simugeno objects. The function simugeno creates a simugeno object from a tabfreq object. The function as.simugeno is an alias for simugeno function. is.simugeno tests if an object is a valid simugeno object. Note: to get the manpage about simugeno, please type 'class ? simugeno'.

Usage

simugeno(tab,which.loc=NULL,n=1)
as.simugeno(tab,which.loc=NULL,n=1)
is.simugeno(x)

Arguments

tab
a tabfreq object created with constructor tabfreq
which.loc
a character vector giving the chosen loci for the genotypes simulation. The default is set to NULL, which corresponds to all the loci of the tabfreq object given in argument
n
integer vector giving the number of individuals. If there are several populations, n gives the numbers of individuals to simulate per population. For a single population, default is 1.
x
an object

Value

  • For simugeno and as.simugeno, a simugeno object. For is.simugeno, a logical.

encoding

UTF-8

Details

At a given locus, an individual's genotype is simulated by randomly drawing two alleles (with replacement) at their respective allele frequencies in the target population.

See Also

"simugeno", and tabfreq for creating a tabfreq object from a data file.

Examples

Run this code
data(Tu)
tab<-tabfreq(Tu)
#simulation of 3 individual genotypes for the STR  marker FGA
geno1 <- simugeno(tab,which.loc='FGA', n =100)
geno1@tab.geno

Run the code above in your browser using DataLab